/**
 * @file bsp_modem.h
 * @brief 
 * @author  ()
 * @version 1.0
 * @date 2024-09-13
 * @ingroup bsp
 * @copyright Copyright (C) 2019 Queclink Wireless Solutions (ShenZhen) Co., Ltd. All Rights Reserved.
 * 
 * @par 修改日志:
 * <table>
 * <tr><th>Date       <th>Version <th>Author  <th>Description
 * <tr><td>2024-09-13 <td>1.0     <td>     <td>内容
 * </table>
 */
#ifndef __BSP_MODEM_H
#define __BSP_MODEM_H


#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#include "global.h"


#ifdef __cplusplus
extern "C" {
#endif

int32_t bsp_modem_init(void);

void bsp_modem_powerctrl_on(void);
void bsp_modem_powerctrl_off(void);
void bsp_modem_powerkey(int32_t status);
bool bsp_modem_get_power_status(void);



int32_t bsp_modem_ring_get(void);
void bsp_modem_dtr_set(int32_t status);
bool bsp_modem_dtr_get(void);


void bsp_modem_ri_int_enable(void (*isr)(void *ptr), void *ptr);
void bsp_modem_ri_int_disable(void);
int32_t modem_uart_sleep(void);
void modem_uart_wakeup(void);



ssize_t bsp_modem_write(const void *data, size_t size);
ssize_t bsp_modem_read(void *data, size_t size);
void    bsp_modem_set_baudrate(uint32_t bps);

void bsp_modem_recv_handler(void);
void bsp_modem_recv_set_ready(void);
void bsp_modem_send_handler(void);
#ifdef __cplusplus
}
#endif


#endif
